﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}
@section css {
    <link href="~/Assets/css/previewImage.css" rel="stylesheet" />
    <style>
        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }
        .btn_addPic {
            display: block;
            position: relative;
            width: 53px;
            height: 53px;
            overflow: hidden;
            cursor: pointer;
            text-align: center;
        }

        .filePrew {
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            width: 53px;
            height: 53px;
            opacity: 0;
        }

    </style>
}
<header class="mui-bar mui-bar-nav">
    <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left" style="color:white;">
        <span class="mui-icon mui-icon-left-nav" style=""></span>
    </button>
    <h1 class="mui-title" style="color:white;">问题登记</h1>
</header>

<div class="mui-content" style="margin: 5px;" ng-cloak ng-controller="HiddenTroubleController" ng-init="
     FormId='@(Request.QueryString["FormId"].IsEmpty() ? "0" : Request.QueryString["FormId"])';
     page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     pagename = '@(Request.QueryString["pagename"].IsEmpty() ? "" : Request.QueryString["pagename"])';
     IsCheck = '@(Request.QueryString["IsCheck"].IsEmpty() ? "0" : Request.QueryString["IsCheck"])';
     BindDepartmentList('Dep_Select');
     GetFactoryArea();
     GetHiddenTroubleType();
     GetHiddenTroubleEditDetail(FormId);
     GetHiddenTroubleLevelList();
     GetSourceList();
     Loading = false;
     ImageCount=[0,1,2];
      InitImgeUpload('HiddenTroubleForm');
     ">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>园区</label>
            <select ng-model="HiddenTroubleEditModel.FactoryAreaId" ng-change="MGetPlaceList(HiddenTroubleEditModel.FactoryAreaId);">
                <option value="">请选择园区</option>
                <option ng-repeat="x in FactoryArea" value="{{x.Id}}">{{x.ParkName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>场所</label>
            <select ng-model="HiddenTroubleEditModel.PlaceId">
                <option value="">请选择场所</option>
                <option ng-repeat="x in PlaceList" value="{{x.Id}}">{{x.PlaceName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>位置</label>
            <input type="text" placeholder="地点/部位" ng-model="HiddenTroubleEditModel.Location" />
        </div>
        <div class="mui-input-row">
            <label>责任部门</label>
            <select id="Dep_Select" ng-model="HiddenTroubleEditModel.DepartmentId" ng-change="GetEmployeeByDepartment(HiddenTroubleEditModel.DepartmentId);">
            </select>
        </div>
        <div class="mui-input-row">
            <label>责任人</label>
            <select ng-model="HiddenTroubleEditModel.ResponsibleEmloyeeNo" class="form-control">
                <option value="">请选择责任人</option>
                <option ng-repeat="x in EmployeeList" value="{{x.EmployeeNo}}">{{x.EmployeeNo}}-{{x.EmployeeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>来源</label>
            <select ng-model="HiddenTroubleEditModel.SourceId" ng-change="" class="form-control">
                <option value="">请选择来源</option>
                <option ng-repeat="x in SourceList" value="{{x.Id}}">{{x.Source}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>问题等级</label>
            <select ng-model="HiddenTroubleEditModel.LevelId" ng-change="" class="form-control">
                <option value="">请选择问题等级</option>
                <option ng-repeat="x in LevelList" value="{{x.Id}}" title="{{x.Description}}">{{x.LevelName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>问题分类</label>
            <select ng-model="HiddenTroubleEditModel.CategoryAreaId" ng-change="GetHiddenTroubleTypeChild(HiddenTroubleEditModel.CategoryAreaId,'div_typeselect');" class="form-control">
                <option value="">请选择问题分类</option>
                <option ng-repeat="x in CategoryList" value="{{x.Id}}">{{x.TypeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>问题子类</label>
            <select ng-model="HiddenTroubleEditModel.TypeId" class="form-control">
                <option value="">请选择问题子类</option>
                <option ng-repeat="x in CategoryChildList" value="{{x.Id}}">{{x.TypeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>检查日期</label>
            <input type="text" ng-model="HiddenTroubleEditModel.CheckTime" readonly>
        </div>
        <div class="mui-input-row">
            <label>登记人</label>
            <input type="text" ng-model="User.UserName" readonly>
        </div>

    </form>

    <div class="mui-input-row" style="margin: 10px 5px;">
        <textarea id="textarea" rows="5" placeholder="问题描述" ng-model="HiddenTroubleEditModel.Description"></textarea>
    </div>
    <div class="mui-input-row" style="margin: 10px 5px;">
        <textarea id="textarea" rows="5" placeholder="此处输入整改要求" ng-model="HiddenTroubleEditModel.Requirement"></textarea>
    </div>
    <p>问题照片</p>
    <div class="row image-list" style="margin-top:20px;margin-bottom:50px;">
        <img class="image-item space" style="display:inline-block;margin-left:10px;" ng-src="{{x.FilePath}}" width="50" data-preview-src="" data-preview-group="1" ng-repeat="x in HiddenTroubleEditModel.FileList" />
    </div>
    <p>添加照片</p>
    <div class="row image-list" style="margin-top:20px;margin-bottom:100px;">
        <div style="float:left;margin-left:10px;" ng-repeat="x in ImageCount" id="imagebox_{{x}}">

        </div>
    </div>
    <div class="mui-button-row" style="margin-bottom:80px;">
        <button type="button" ng-click="EditHiddenTroubleForm(FormId,HiddenTroubleEditModel,IsCheck,pagename);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">保 &nbsp;&nbsp;存</button>
        <button type="button" ng-show="HiddenTroubleEditModel.State==0 && IsCheck=='0'" ng-click="EditHiddenTroubleForm(FormId,HiddenTroubleEditModel,'2',pagename);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">提 &nbsp;&nbsp;交</button>
        <button type="button" ng-show="HiddenTroubleEditModel.State==0 && IsCheck==1" ng-click="RemoveHiddenTrouble(FormId);" ng-disabled="Loading" class="mui-btn mui-btn-danger mui-btn-block">撤 &nbsp;&nbsp;销</button>
    </div>

</div>
@section js{
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/mui.zoom.js"></script>
    <script src="~/Assets/js/mui.previewimage.js"></script>
    <script src="~/Assets/js/pg/MHiddenTrouble.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>
    <script>
        
        mui.showLoading("正在加载..", "div");

        setTimeout(function () {
            mui.hideLoading();
            mui.previewImage();
        }, 2000);
    </script>
}
